import React, {PropTypes,Component} from "react";
import {
	View,
	Text,
	StyleSheet,
} from "react-native";
import Icon from 'react-native-vector-icons/FontAwesome';
import CustomTitle from "../public/CustomTitle";

var TextBtn = [
	{title:'我的健康档案', nav: "HealthRecord"},
	{title:'注册邀请码', nav: "RegisterCode"},
	{title:'我的个人资料', nav: "PersonalInfo"},
	{title:'认证', nav: "HealthRecord"},
	{title:'我的家庭健康管理师', nav: "HealthRecord"},
	{title:'健康管理方案', nav: "HealthRecord"},
	{title:'设置', nav: "HealthRecord"},
];

export default class TitleArray extends Component{

	constructor(props){
		super(props);
	}

	renderText(item){
		return(
			<CustomTitle 
				key={item.title}
				title={item.title}
				rightIcon={<Icon name="angle-double-right" size={18} />}
				textStyle={{fontSize:gFontSize.middleText}}
				style={{paddingVertical:10,borderBottomWidth:1,
					borderBottomColor:gColor.borderColors,
					backgroundColor:gColor.whiteColor,
				}}
				redirectPress={() => this.props.navigation.navigate(item.nav)}
			/>
		)
	}

	render(){
		return(
			<View>
				{
					TextBtn.map((item)=>this.renderText(item))
				}
				
			</View>
		)
	}
}